<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>试卷展示</title>
  <link rel="stylesheet" href="../../static/css/all.min.css">
  <style>
    :root {
      --primary-color: #4361ee;
      --secondary-color: #3f37c9;
      --completed-color: #1a237e;
      --light-color: #f8f9fa;
      --dark-color: #212529;
      --border-radius: 8px;
      --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      --border-color: #e0e0e0;
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background-color: #f5f7fa;
      color: var(--dark-color);
      line-height: 1.6;
      height: 100vh;
      overflow: hidden;
    }

    .container {
      display: flex;
      max-width: 1200px;
      height: 100%;
      margin: 0 auto;
      background: white;
      border-radius: var(--border-radius);
      box-shadow: var(--box-shadow);
      overflow: hidden;
    }

    /* 左侧导航栏 */
    .sidebar {
      width: 250px;
      background-color: #f8f9fa;
      border-right: 1px solid var(--border-color);
      padding: 20px;
      overflow-y: auto;
    }

    .sidebar-header {
      padding-bottom: 15px;
      border-bottom: 1px solid var(--border-color);
      margin-bottom: 15px;
    }

    .sidebar-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--dark-color);
    }

    .question-nav {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .question-category {
      margin-bottom: 10px;
    }

    .category-title {
      padding: 8px 0;
      font-weight: 500;
      color: var(--primary-color);
      margin-bottom: 10px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .question-list {
      list-style: none;
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .question-item {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s;
      border-radius: var(--border-radius);
      background-color: white;
      border: 1px solid var(--border-color);
    }

    .question-item:hover {
      border-color: var(--primary-color);
    }

    .question-item.completed {
      background-color: var(--primary-color);
      color: white;
      border-color: var(--primary-color);
    }

    .question-item.current {
      border: 2px solid var(--primary-color);
      background-color: white;
      color: var(--dark-color);
    }

    /* 右侧内容区 */
    .main-content {
      flex: 1;
      padding: 30px;
      overflow-y: auto;
      /* 为固定的倒计时留出右侧空间 */
      padding-right: 120px;
    }

    .paper-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 20px;
      border-bottom: 1px solid var(--border-color);
    }

    .timer {
      font-size: 16px;
      color: #dc3545;
      font-weight: 600;
      /* 固定定位设置 - 固定在右上角 */
      position: fixed;
      top: 20px;
      right: 40px;
      background-color: white;
      padding: 8px 12px;
      border-radius: var(--border-radius);
      box-shadow: var(--box-shadow);
      z-index: 999;
    }

    .paper-title {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 10px;
    }

    .paper-info {
      color: #6c757d;
      font-size: 14px;
      display: flex;
      justify-content: center;
      gap: 20px;
    }

    .question-container {
      margin-bottom: 40px;
    }

    .question-type {
      font-size: 18px;
      font-weight: 500;
      color: var(--primary-color);
      margin-bottom: 15px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-color);
    }

    .question-block {
      background-color: #f8f9fa;
      border-radius: var(--border-radius);
      padding: 20px;
      margin-bottom: 20px;
      scroll-margin-top: 80px;
    }

    .question-title {
      font-weight: 500;
      margin-bottom: 15px;
      display: flex;
    }

    .question-text {
      margin-bottom: 15px;
    }

    .options-list {
      list-style: none;
    }

    .option-item {
      margin-bottom: 10px;
      display: flex;
      align-items: flex-start;
      cursor: pointer;
    }

    .option-radio {
      display: none;
    }

    .option-label {
      width: 24px;
      height: 24px;
      border: 1px solid #adb5bd;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 10px;
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .option-radio:checked + .option-label::after {
      content: "✓";
      font-size: 14px;
      color: white;
    }

    .option-radio:checked + .option-label {
      background-color: var(--primary-color);
      border-color: var(--primary-color);
    }

    .answer-input {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius);
      font-family: inherit;
    }

    .answer-textarea {
      width: 100%;
      min-height: 100px;
      padding: 12px;
      border: 1px solid var(--border-color);
      border-radius: var(--border-radius);
      font-family: inherit;
      resize: vertical;
    }

    /* 操作按钮 */
    .action-buttons {
      display: flex;
      justify-content: space-between;
      margin-top: 30px;
      padding-top: 20px;
      border-top: 1px solid var(--border-color);
    }

    .btn {
      padding: 10px 20px;
      border: none;
      border-radius: var(--border-radius);
      cursor: pointer;
      font-size: 14px;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-primary {
      background-color: var(--primary-color);
      color: white;
    }

    .btn-primary:hover {
      background-color: var(--secondary-color);
    }

    .btn-outline {
      background-color: transparent;
      border: 1px solid var(--border-color);
      color: var(--dark-color);
    }

    .btn-outline:hover {
      background-color: #f8f9fa;
    }

    /* 简答题专用样式 */
    .question-block[data-type="简答题"] {
      border: 1px solid #e0e0e0;
      border-radius: 8px;
      padding: 15px;
      margin-bottom: 20px;
      background: #f9f9f9;
    }

    .essay-answer-area {
      margin-top: 15px;
    }

    .answer-textarea {
      width: 100%;
      padding: 12px;
      border: 1px solid #ddd;
      border-radius: 4px;
      resize: vertical;
      min-height: 120px;
      font-size: 15px;
      line-height: 1.5;
    }

    .word-count {
      text-align: right;
      color: #6c757d;
      font-size: 13px;
      margin-top: 5px;
    }

    .reference-answer {
      margin-top: 20px;
      padding: 10px;
      background: #f0f8ff;
      border-left: 3px solid #4285f4;
    }

    .back-button {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 16px;
      background: white;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .back-button:hover {
      background-color: #f8f9fa;
    }
  </style>
</head>
<body>
<div class="container">
  <!-- 左侧导航栏 -->
  <div class="sidebar">
    <div class="sidebar-header">
      <div class="sidebar-title">试卷导航</div>
    </div>
    <div class="question-nav">
      <!-- 选择题 -->
      <div class="question-category">
        <div class="category-title">
          <span>选择题</span>
          <span>5题</span>
        </div>
        <ul class="question-list">
          <li class="question-item current" data-id="q1">1</li>
          <li class="question-item" data-id="q2">2</li>
          <li class="question-item" data-id="q3">3</li>
          <li class="question-item" data-id="q4">4</li>
          <li class="question-item" data-id="q5">5</li>
        </ul>
      </div>
    </div>
  </div>

  <!-- 右侧内容区 -->
  <div class="main-content">
    <div class="paper-header">
      <h1 class="paper-title">大学化学7</h1>
      <div class="paper-info">
        <span class="creator">科目：数学</span>
        <span class="duration">时间：120分钟</span>
        <span class="totalScore">总分：100分</span>
      </div>
      <button class="back-button">
        <i class="fas fa-arrow-left"></i>
        <span>返回</span>
      </button>
    </div>
    <!-- 选择题 -->
    <div class="question-container" id="choice-questions">
      <h3 class="question-type">
        <i class="fas fa-check-circle"></i> 一、选择题（每题2分，共10分）
      </h3>
      <!-- 第1题 -->
      <div class="question-block" id="q1">
        <div class="question-title">
          <span>1. 下列哪个数是质数？</span>
          <span style="margin-left: auto; color: #6c757d; font-size: 14px;">(2分)</span>
        </div>
        <ul class="options-list">
          <li class="option-item">
            <input type="radio" name="q1" id="q1-a" class="option-radio" value="A">
            <label for="q1-a" class="option-label"></label>
            <div class="option-text">12</div>
          </li>
          <li class="option-item">
            <input type="radio" name="q1" id="q1-b" class="option-radio" value="B">
            <label for="q1-b" class="option-label"></label>
            <div class="option-text">15</div>
          </li>
          <li class="option-item">
            <input type="radio" name="q1" id="q1-c" class="option-radio" value="C">
            <label for="q1-c" class="option-label"></label>
            <div class="option-text">17</div>
          </li>
          <li class="option-item">
            <input type="radio" name="q1" id="q1-d" class="option-radio" value="D">
            <label for="q1-d" class="option-label"></label>
            <div class="option-text">21</div>
          </li>
        </ul>
      </div>
    </div>
    <!-- 填空题 -->
    <div class="question-container" id="fill-questions">
      <h3 class="question-type">
        <i class="fas fa-pencil-alt"></i> 二、填空题（每题3分，共9分）
      </h3>
      <!-- 第6题 -->
      <div class="question-block" id="q6">
        <div class="question-title">
          <span>6. 三角形内角和等于______度。</span>
          <span style="margin-left: auto; color: #6c757d; font-size: 14px;">(3分)</span>
        </div>
        <input type="text" class="answer-input" placeholder="请在此输入答案">
      </div>
    </div>
    <!-- 判断题 -->
    <div class="question-container" id="judge-questions">
      <h3 class="question-type">
        <i class="fas fa-balance-scale"></i> 三、判断题（每题1分，共4分）
      </h3>
      <!-- 第9题 -->
      <div class="question-block" id="q9">
        <div class="question-title">
          <span>9. 所有偶数都是合数。</span>
          <span style="margin-left: auto; color: #6c757d; font-size: 14px;">(1分)</span>
        </div>
        <div style="display: flex; gap: 15px; margin-top: 10px;">
          <label style="display: flex; align-items: center; cursor: pointer;">
            <input type="radio" name="q9" value="正确" style="margin-right: 5px;"> 正确
          </label>
          <label style="display: flex; align-items: center; cursor: pointer;">
            <input type="radio" name="q9" value="错误" style="margin-right: 5px;"> 错误
          </label>
        </div>
      </div>
    </div>
    <!-- 计算题 -->
    <div class="question-container" id="calculate-questions">
      <h3 class="question-type">
        <i class="fas fa-calculator"></i> 四、计算题（每题10分，共20分）
      </h3>
      <!-- 第14题 -->
      <div class="question-block" id="q14">
        <div class="question-title">
          <span>14. 计算圆的面积，已知半径为4cm。</span>
          <span style="margin-left: auto; color: #6c757d; font-size: 14px;">(10分)</span>
        </div>
        <textarea class="answer-textarea" placeholder="请在此输入解题过程"></textarea>
      </div>
    </div>
  </div>
</div>
<script src="../../static/js/jquery-3.6.0.min.js"></script>
<script src="../../static/js/jquery.cookie.min.js"></script>
<script src="../../static/js/exam_detail.js"></script>
</body>
</html>
